#include <iostream>
#include <vector>
using namespace std;

#define UP 6
#define DOWN 4
#define STAY 5

int main(){
	int N;
	int totalTime = 0;
	cin >> N;
	totalTime = N * STAY;
	vector<int> v;
	int num;
	while (N--){
		cin >> num;
		v.push_back(num);
	}
	totalTime += v.front()*UP;
	if (N == 1){
		cout << totalTime;
		return 0;
	}
	int lastFloor = v.front();
	for (int i = 1; i < v.size(); ++i){
		if (v[i] > lastFloor){
			totalTime += (v[i] - lastFloor) * UP;
		}
		else{
			totalTime += (lastFloor - v[i]) * DOWN;
		}
		lastFloor = v[i];
	}
	cout << totalTime;
	return 0;
}